/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model.impl;

import com.crossriver.crgis.database.model.Company_Contact_Person;
import com.crossriver.crgis.database.model.Company_Contact_PersonModel;
import com.crossriver.crgis.database.model.Company_Contact_PersonSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.List;

/**
 * The base model implementation for the Company_Contact_Person service. Represents a row in the &quot;CRGIA_Company_Contact_Person&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.crossriver.crgis.database.model.Company_Contact_PersonModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link Company_Contact_PersonImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a company_ contact_ person model instance should use the {@link com.crossriver.crgis.database.model.Company_Contact_Person} interface instead.
 * </p>
 *
 * @author Wole Adetiba
 * @see Company_Contact_PersonImpl
 * @see com.crossriver.crgis.database.model.Company_Contact_Person
 * @see com.crossriver.crgis.database.model.Company_Contact_PersonModel
 * @generated
 */
public class Company_Contact_PersonModelImpl extends BaseModelImpl<Company_Contact_Person>
	implements Company_Contact_PersonModel {
	public static final String TABLE_NAME = "CRGIA_Company_Contact_Person";
	public static final Object[][] TABLE_COLUMNS = {
			{ "applicationId", new Integer(Types.VARCHAR) },
			{ "userId", new Integer(Types.VARCHAR) },
			{ "designation", new Integer(Types.VARCHAR) },
			{ "title", new Integer(Types.VARCHAR) },
			{ "lastName", new Integer(Types.VARCHAR) },
			{ "firstName", new Integer(Types.VARCHAR) },
			{ "middleName", new Integer(Types.VARCHAR) },
			{ "phoneHome", new Integer(Types.VARCHAR) },
			{ "phoneOffice", new Integer(Types.VARCHAR) },
			{ "phoneMobile", new Integer(Types.VARCHAR) },
			{ "fax", new Integer(Types.VARCHAR) },
			{ "emailAddress", new Integer(Types.VARCHAR) },
			{ "identificationDoc", new Integer(Types.VARCHAR) },
			{ "identificationDocNo", new Integer(Types.VARCHAR) }
		};
	public static final String TABLE_SQL_CREATE = "create table CRGIA_Company_Contact_Person (applicationId VARCHAR(75) not null primary key,userId VARCHAR(75) null,designation VARCHAR(75) null,title VARCHAR(75) null,lastName VARCHAR(75) null,firstName VARCHAR(75) null,middleName VARCHAR(75) null,phoneHome VARCHAR(75) null,phoneOffice VARCHAR(75) null,phoneMobile VARCHAR(75) null,fax VARCHAR(75) null,emailAddress VARCHAR(75) null,identificationDoc VARCHAR(75) null,identificationDocNo VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table CRGIA_Company_Contact_Person";
	public static final String ORDER_BY_JPQL = " ORDER BY company_Contact_Person.applicationId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CRGIA_Company_Contact_Person.applicationId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.crossriver.crgis.database.model.Company_Contact_Person"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.crossriver.crgis.database.model.Company_Contact_Person"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Company_Contact_Person toModel(
		Company_Contact_PersonSoap soapModel) {
		Company_Contact_Person model = new Company_Contact_PersonImpl();

		model.setApplicationId(soapModel.getApplicationId());
		model.setUserId(soapModel.getUserId());
		model.setDesignation(soapModel.getDesignation());
		model.setTitle(soapModel.getTitle());
		model.setLastName(soapModel.getLastName());
		model.setFirstName(soapModel.getFirstName());
		model.setMiddleName(soapModel.getMiddleName());
		model.setPhoneHome(soapModel.getPhoneHome());
		model.setPhoneOffice(soapModel.getPhoneOffice());
		model.setPhoneMobile(soapModel.getPhoneMobile());
		model.setFax(soapModel.getFax());
		model.setEmailAddress(soapModel.getEmailAddress());
		model.setIdentificationDoc(soapModel.getIdentificationDoc());
		model.setIdentificationDocNo(soapModel.getIdentificationDocNo());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Company_Contact_Person> toModels(
		Company_Contact_PersonSoap[] soapModels) {
		List<Company_Contact_Person> models = new ArrayList<Company_Contact_Person>(soapModels.length);

		for (Company_Contact_PersonSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.crossriver.crgis.database.model.Company_Contact_Person"));

	public Company_Contact_PersonModelImpl() {
	}

	public String getPrimaryKey() {
		return _applicationId;
	}

	public void setPrimaryKey(String pk) {
		setApplicationId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _applicationId;
	}

	public String getApplicationId() {
		if (_applicationId == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationId;
		}
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		if (_userId == null) {
			return StringPool.BLANK;
		}
		else {
			return _userId;
		}
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getDesignation() {
		if (_designation == null) {
			return StringPool.BLANK;
		}
		else {
			return _designation;
		}
	}

	public void setDesignation(String designation) {
		_designation = designation;
	}

	public String getTitle() {
		if (_title == null) {
			return StringPool.BLANK;
		}
		else {
			return _title;
		}
	}

	public void setTitle(String title) {
		_title = title;
	}

	public String getLastName() {
		if (_lastName == null) {
			return StringPool.BLANK;
		}
		else {
			return _lastName;
		}
	}

	public void setLastName(String lastName) {
		_lastName = lastName;
	}

	public String getFirstName() {
		if (_firstName == null) {
			return StringPool.BLANK;
		}
		else {
			return _firstName;
		}
	}

	public void setFirstName(String firstName) {
		_firstName = firstName;
	}

	public String getMiddleName() {
		if (_middleName == null) {
			return StringPool.BLANK;
		}
		else {
			return _middleName;
		}
	}

	public void setMiddleName(String middleName) {
		_middleName = middleName;
	}

	public String getPhoneHome() {
		if (_phoneHome == null) {
			return StringPool.BLANK;
		}
		else {
			return _phoneHome;
		}
	}

	public void setPhoneHome(String phoneHome) {
		_phoneHome = phoneHome;
	}

	public String getPhoneOffice() {
		if (_phoneOffice == null) {
			return StringPool.BLANK;
		}
		else {
			return _phoneOffice;
		}
	}

	public void setPhoneOffice(String phoneOffice) {
		_phoneOffice = phoneOffice;
	}

	public String getPhoneMobile() {
		if (_phoneMobile == null) {
			return StringPool.BLANK;
		}
		else {
			return _phoneMobile;
		}
	}

	public void setPhoneMobile(String phoneMobile) {
		_phoneMobile = phoneMobile;
	}

	public String getFax() {
		if (_fax == null) {
			return StringPool.BLANK;
		}
		else {
			return _fax;
		}
	}

	public void setFax(String fax) {
		_fax = fax;
	}

	public String getEmailAddress() {
		if (_emailAddress == null) {
			return StringPool.BLANK;
		}
		else {
			return _emailAddress;
		}
	}

	public void setEmailAddress(String emailAddress) {
		_emailAddress = emailAddress;
	}

	public String getIdentificationDoc() {
		if (_identificationDoc == null) {
			return StringPool.BLANK;
		}
		else {
			return _identificationDoc;
		}
	}

	public void setIdentificationDoc(String identificationDoc) {
		_identificationDoc = identificationDoc;
	}

	public String getIdentificationDocNo() {
		if (_identificationDocNo == null) {
			return StringPool.BLANK;
		}
		else {
			return _identificationDocNo;
		}
	}

	public void setIdentificationDocNo(String identificationDocNo) {
		_identificationDocNo = identificationDocNo;
	}

	public Company_Contact_Person toEscapedModel() {
		if (isEscapedModel()) {
			return (Company_Contact_Person)this;
		}
		else {
			return (Company_Contact_Person)Proxy.newProxyInstance(Company_Contact_Person.class.getClassLoader(),
				new Class[] { Company_Contact_Person.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Company_Contact_PersonImpl company_Contact_PersonImpl = new Company_Contact_PersonImpl();

		company_Contact_PersonImpl.setApplicationId(getApplicationId());

		company_Contact_PersonImpl.setUserId(getUserId());

		company_Contact_PersonImpl.setDesignation(getDesignation());

		company_Contact_PersonImpl.setTitle(getTitle());

		company_Contact_PersonImpl.setLastName(getLastName());

		company_Contact_PersonImpl.setFirstName(getFirstName());

		company_Contact_PersonImpl.setMiddleName(getMiddleName());

		company_Contact_PersonImpl.setPhoneHome(getPhoneHome());

		company_Contact_PersonImpl.setPhoneOffice(getPhoneOffice());

		company_Contact_PersonImpl.setPhoneMobile(getPhoneMobile());

		company_Contact_PersonImpl.setFax(getFax());

		company_Contact_PersonImpl.setEmailAddress(getEmailAddress());

		company_Contact_PersonImpl.setIdentificationDoc(getIdentificationDoc());

		company_Contact_PersonImpl.setIdentificationDocNo(getIdentificationDocNo());

		return company_Contact_PersonImpl;
	}

	public int compareTo(Company_Contact_Person company_Contact_Person) {
		int value = 0;

		value = getApplicationId()
					.compareTo(company_Contact_Person.getApplicationId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Company_Contact_Person company_Contact_Person = null;

		try {
			company_Contact_Person = (Company_Contact_Person)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = company_Contact_Person.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(29);

		sb.append("{applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", designation=");
		sb.append(getDesignation());
		sb.append(", title=");
		sb.append(getTitle());
		sb.append(", lastName=");
		sb.append(getLastName());
		sb.append(", firstName=");
		sb.append(getFirstName());
		sb.append(", middleName=");
		sb.append(getMiddleName());
		sb.append(", phoneHome=");
		sb.append(getPhoneHome());
		sb.append(", phoneOffice=");
		sb.append(getPhoneOffice());
		sb.append(", phoneMobile=");
		sb.append(getPhoneMobile());
		sb.append(", fax=");
		sb.append(getFax());
		sb.append(", emailAddress=");
		sb.append(getEmailAddress());
		sb.append(", identificationDoc=");
		sb.append(getIdentificationDoc());
		sb.append(", identificationDocNo=");
		sb.append(getIdentificationDocNo());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(46);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Company_Contact_Person");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>designation</column-name><column-value><![CDATA[");
		sb.append(getDesignation());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>title</column-name><column-value><![CDATA[");
		sb.append(getTitle());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>lastName</column-name><column-value><![CDATA[");
		sb.append(getLastName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>firstName</column-name><column-value><![CDATA[");
		sb.append(getFirstName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>middleName</column-name><column-value><![CDATA[");
		sb.append(getMiddleName());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>phoneHome</column-name><column-value><![CDATA[");
		sb.append(getPhoneHome());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>phoneOffice</column-name><column-value><![CDATA[");
		sb.append(getPhoneOffice());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>phoneMobile</column-name><column-value><![CDATA[");
		sb.append(getPhoneMobile());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fax</column-name><column-value><![CDATA[");
		sb.append(getFax());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>emailAddress</column-name><column-value><![CDATA[");
		sb.append(getEmailAddress());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>identificationDoc</column-name><column-value><![CDATA[");
		sb.append(getIdentificationDoc());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>identificationDocNo</column-name><column-value><![CDATA[");
		sb.append(getIdentificationDocNo());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _applicationId;
	private String _userId;
	private String _designation;
	private String _title;
	private String _lastName;
	private String _firstName;
	private String _middleName;
	private String _phoneHome;
	private String _phoneOffice;
	private String _phoneMobile;
	private String _fax;
	private String _emailAddress;
	private String _identificationDoc;
	private String _identificationDocNo;
}